<template>
  <div class="specBox spec_set">

    <div class="conten_item">
      <div class="radioitem">
        <label>必须标注属性</label>
        <ul class="radio">
          <li @click="changeproperty(true)" :class="{'selected':exchangeproperty==true}">是</li>
          <li @click="changeproperty(false)" :class="{'selected':exchangeproperty==false}">否</li>
        </ul>
      </div>
      <div class="radioitem">
        <label>必须转写文本</label>
        <ul class="radio">
          <li @click="changetranscription(true)" :class="{'selected':isTranscription ==true}">是</li>
          <li @click="changetranscription(false)" :class="{'selected':isTranscription ==false}">否</li>
        </ul>
      </div>
    </div>
  </div>

</template>
<script>
export default {
  name: "SpecSetting",
  data() {
    return {
      edit: "",
      //////////////////
      exchangeproperty: true, //是否允许不标属性
      isTranscription: true, //是否必须进行转写
      /////////////////////////
      arrowShow: false,
      btncolor: false,


    };
  },
  props: ["editSpecData"],
  created() {
    // if (this.editSpecData) {
    // }
  },
  methods: {


    changeproperty: function (flag) {
      this.exchangeproperty = flag;
    },
    changetranscription: function (flag) {
      this.isTranscription = flag;
    },





    GetQueryString: function (name) {
      //流转任务时获取batchid
      var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
      var r = window.location.search.substr(1).match(reg);
      if (r != null) return unescape(r[2]);
      return null;
    }
  },
  watch: {
    editSpecData(val) {
      Object.keys(this.editSpecData).forEach(key => {
        if (this.$data.hasOwnProperty(key)) {
          this.$set(this, key, val[key])
        }
      })
    }
  },
  mounted: function () {
    if (this.GetQueryString("taskId")) {
      this.taskId = this.GetQueryString("taskId");
    }
    if (this.GetQueryString("edit")) {
      this.edit = this.GetQueryString("edit");
    }
    // if (this.childLabel.label.length > 0 && this.edit == "true") {
    //     //添加属性，已存在的标签不能删除
    //     for (let i = 0; i < this.childLabel.label.length; i++) {
    //         this.$set(this.childLabel.label[i], "edit", false);
    //     }
    // } else if (
    //     this.edit == null ||
    //     this.edit == undefined ||
    //     this.edit == ""
    // ) {
    //     for (let i = 0; i < this.childLabel.label.length; i++) {
    //         this.$set(this.childLabel.label[i], "edit", true);
    //     }
    // }
  },
  components: {
  }
};
</script>



<style lang="less" scoped>

.spec_set {
  .radioitem {
    height: 34px;
    line-height: 14px;
    margin: 15px 0 15px 0;
    .radio {
      height: 14px;
      line-height: 14px;
      float: left;
      margin-top: 10px;
      width: auto;
      margin-left: 0;
      li {
        margin-right: 40px;
        font-size: 14px;
        color: #333;
        cursor: pointer;
        padding-left: 22px;
        display: inline-block;
        background: url("~@/assets/images/common/radio.png") no-repeat -119px 0;
        float: left;
        width: auto;
      }
      li.selected {
        background-position: 0 0;
      }
      li.selected[type="cursor"] {
        cursor: default;
      }
    }
    label {
      width: 100px;
      padding-right: 10px;
      text-align: right;
      float: left;
      line-height: 34px;
      color: #666;
    }
  }

  .integralall {
    padding: 21px 20px 1px 20px;
    background: #fafafa;
    a {
      color: #fe8432;
    }
    b {
      color: #0078ff;
    }

    input {
      border: 1px solid #ccc;
      padding: 9px 10px;
      font-size: 14px;
      line-height: 14px;
      width: 85px;
      display: inline-block;
      margin: 0 10px 20px 10px;
    }
  }
  .countbtn {
    margin: 0 0 20px 15px;
    label {
      color: #666;
    }
    a {
      display: inline-block;
      width: 100px;
      font-size: 14px;
      color: #969696;
      border: 1px solid #ccc;
      border-radius: 5px;
      text-align: center;
      margin-right: 10px;
      padding: 5px 0;
    }
    .btncolor {
      background: #e0fdee;
      color: #16cb6d;
      border: 1px solid #16cb6d;
    }
  }

  // .integralbox .line {
  //   padding: 20px 20px 0 20px;
  //   background: #fafafa;
  // }
  // .line a {
  //   color: #fe8432;
  // }

  // .line b {
  //   color: #0078ff;
  // }

  // .integralbox .line {
  //   padding: 20px 20px 0 20px;
  //   background: #fafafa;
  // }
  // .integralbox .line input {
  //   border: 1px solid #ccc;
  //   padding: 9px 10px;
  //   font-size: 14px;
  //   line-height: 14px;
  //   width: 85px;
  //   display: inline-block;
  //   margin: 0 10px 20px 10px;
  // }
  // .integralbox #checkinput .jx {
  //   color: red;
  // }
  // .inputcheck #checkinput .jx {
  //   display: inline-block;
  //   color: red;
  //   margin-left: -370px;
  // }
  // .integralBox .integralall input {
  //   border: 1px solid #ccc;
  //   padding: 9px 10px;
  //   font-size: 14px;
  //   line-height: 14px;
  //   width: 85px;
  //   display: inline-block;
  //   margin: 0 10px 20px 10px;
  // }
  // .integralbox {
  //   margin: 20px 0 20px 0;
  // }
}
</style>
